package zuoye11;

public class FizzBuzz extends Thread {
    public static int n;
    public FizzBuzz(int n)
    {
        FizzBuzz.n = n;
    }
    public  void fizz()
    {for (int i=1;i<=n;i++) {
        if (i % 3 == 0) {
            System.out.print(i+"fizz  ");
        }
    }
    }
    public  void buzz()
    {for (int i=1;i<=n;i++) {
        if (i % 5== 0) {
            System.out.print(i+"buzz  ");
        }
    }
    }
    public  void fizzbuzz()
    {
        for (int i=1;i<=n;i++) {
        if (i % 5== 0&&i%3==0) {
            System.out.print(i+"fizzbuzz  ");
        }
    }
    }
    public  void number() {
        for (int i = 1; i <= n; i++) {
            if (i % 5 != 0 && i % 3 != 0) {
                System.out.print(i+"  " );
            }
        }
    }

}
